<%-- 
    Document   : index
    Created on : Aug 4, 2012, 1:14:12 AM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>Events today</title>
        <link rel="stylesheet" href="CSS/style_1.css" type="text/css" charset="utf-8" />

    </head>
    <body>
        <div id="wrapper">
            <div id="header"> </div>
            <div id="left">
                <div id="logo">
                    <h1>Four Idiots</h1>
                    <p>Company Portal</p>
                </div>
                <div id="nav">
                    <ul>
                        <li class="important"><a href="Home.jsp">Home</a></li>
                        <li><a href="index.jsp">Events</a></li>
                        <li><a href="Statistic.jsp">Statistic</a></li>
                        <li><a href="FeedBack.jsp">FeedBack</a></li>
                        <li><a href="Winners">Winners</a></li>
                        <li><a href="Help.jsp">Help</a></li>
                        <li><a href="LoginForm.jsp">Login</a></li>
                    </ul>
                </div>
                <div id="news">

                </div>
                <div id="support">
                    <p><b>Phone:01652-384-764</b></p>
                    <p><b>Email:support@fouridiots.com</b></p>
                </div>
            </div>
            <div id="right">
                <div align="center">                    
                    <c:if test="${not empty requestScope.dob}">
                        <font style="color: orange;font-size: 16px">Say "Happy birth day!" to ${requestScope.countdob} people today!</font>
                        <p>
                            <img src="images/events/dob1.jpg" style="width:100x;height:100px"></img>
                            <img src="images/events/dob2.jpg" style="width:150x;height:100px"></img>
                            <img src="images/events/dob3.jpg" style="width:150x;height:100px"></img>
                        </p>
                        <div align="right">
                            <c:url var="ShowUser" value="Controllers" >
                                <c:param name="btAction" value="ShowUser"></c:param>
                            </c:url>
                            <a href="${ShowUser}" >View Details</a>
                        </div>
                    </c:if>
                    <div align="center">
                        <c:if test="${not empty requestScope.userevent}">
                            <c:forEach items="${requestScope.userevent}" var="u">
                                <c:url var="ShowUserDetail" value="Controllers" >

                                    <c:param name="usercode" value="${u.codeCustomer}"></c:param>
                                    <c:param name="btAction" value="ShowUserDetail"></c:param>
                                </c:url>                                
                                <table>
                                    <tr>
                                        <td>View contact information: </td>
                                        <td><a href="${ShowUserDetail}" > ${u.userCustomer}</a></td>
                                    </tr>
                                </table>
                            </c:forEach>
                        </c:if>
                               
                        <c:if test="${not empty requestScope.userdetail}">
                            <c:forEach items="${requestScope.userdetail}" var="ud">
                                Say Happy Birthday to:
                                <table>
                                    <tr>
                                        <td>Name</td>
                                        <td>${ud.fullName}</td>
                                    </tr>
                                    <tr>
                                        <td>DOB</td>
                                        <td>${ud.dob}</td>
                                    </tr>
                                     <tr>
                                        <td>Email</td>
                                        <td>${ud.email}</td>
                                    </tr>
                                     <tr>
                                        <td>Phone</td>
                                        <td>${ud.phoneNumber}</td>
                                    </tr>
                                </table>
                                

                            </c:forEach>
                        </c:if>
                                
                    </div>
                </div>

                <h2>Events</h2>
                <pg:paging pageSize="5">
                    <jsp:useBean id="Customer" class="Models.adapterEvents"></jsp:useBean>
                    <c:forEach items="${Customer.allEvent}" var="e">
                        <pg:item>
                            <div id="welcome">
                                <div>
                                    <table style="width: 100%">

                                        <tr>
                                            <td style="width:20%">
                                                <img src="images/events/${e.images}" style="width:70px;height:65px"></img>
                                            </td>
                                            <td style="width:80%" align="left">
                                                <table style="width:100%">
                                                    <tr>
                                                        <th align="left">${e.nameEvent}</th>
                                                    </tr>
                                                    <tr>
                                                        <td align="left">&nbsp;&nbsp;${e.introduction}</td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">                                                           
                                                            <c:url var="Register" value="Controllers" >
                                                                <c:param name="txtCodes" value="${e.codeEvent}"></c:param>
                                                                <c:param name="txtDate" value="${e.date}"></c:param>
                                                                <c:param name="btAction" value="Register"></c:param>
                                                            </c:url>
                                                            <a href="${Register}" ><img src="images/events/register.jpg" style="width:70px;height:30px"></img></a>
                                                        </td>
                                                    </tr>
                                                </table>

                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <hr/>
                            </div>
                        </pg:item>
                    </c:forEach>

                    <pg:index>
                        <pg:page><%=thisPage%></pg:page>
                        <pg:firstPage>[First]</pg:firstPage>
                        <pg:lastPage>[Last]</pg:lastPage>
                    </pg:index>
                </pg:paging>

            </div>
            <div class="clear"> </div>
            <div id="spacer"> </div>

            <div id="footer">
                <div id="copyright">
                    Copyright &copy; 2012 Four Idiots Company All right reserved.
                </div>
                <div id="footerline"></div>
            </div>

        </div>
    </body>
</html>
